/**
 *
 */
package com.hybris.msig.paymentgateway.adapters;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;

import com.hybris.msig.paymentgateway.dto.MsigPayRequestRefIdDto;
import com.hybris.msig.paymentgateway.facade.MsigCommonPaymentFacade;


/**
 * @author i313922
 *
 */
public abstract class AbstractIPaymentGatewayAdapter implements IPaymentGatewayAdapter
{

	@Resource
	protected MsigCommonPaymentFacade msigCommonPaymentFacade;

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * com.hybris.msig.paymentgateway.adapters.IPaymentGatewayAdapter#paymentRequestRefID(com.hybris.msig.paymentgateway
	 * .dto.MsigPayRequestRefIdDto)
	 */
	@Override
	public String paymentRequestRefID(final MsigPayRequestRefIdDto msigPayRequestRefIdDto)
	{
		return StringUtils.defaultIfEmpty(msigPayRequestRefIdDto.getGtw(), "")
				+ java.util.UUID.randomUUID().getLeastSignificantBits();
	}

	//	/*
	//	 * (non-Javadoc)
	//	 *
	//	 * @see com.hybris.msig.paymentgateway.adapters.IPaymentGatewayAdapter#handlePaymentCallback(java.util.Map)
	//	 */
	//	@Override
	//	public void handlePaymentCallback(final Map<String, String[]> callbackParameters)
	//	{
	//		final PaymentResponseData paymentResponseData = this.buildUpdatePaymentTransactionParameters(callbackParameters);
	//		msigCommonPaymentFacade.updatePaymentTransaction(paymentResponseData);
	//	}

	//	protected abstract PaymentResponseData buildUpdatePaymentTransactionParameters(
	//			final Map<String, String[]> callbackParameters);

}
